**** Replication File for Guisinger and Kleinberg "Unlevel Playing Field"

*** GENERAL
* This do-file utilizes the command estout. See https://repec.sowi.unibe.ch/stata/estout/
* This do-file calls on two different datasets - one at the country level and one at the individual level
* This do-file is organized in order of the main text and appendix

* To install estout
ssc install estout, replace

* To set folder
cd "C:\Users\alexa\Dropbox\Research\Research Projects\Gender Cross National\Submission Docs\FPA_Jan2022\Replication Files"

* Start logfile

log using unlevel_replication, replace

* Open Country Level Data

use "GenderDiff_OECD_replication", clear

*codebook, compact

*** Figure 1: The trade attitude gender gap in 19 OECD Countries (Pew Global Attitudes, 2017)
* This creates the data for the PEW 2017 Excel file in which the chart is made by sorting by the size of the difference using the Stock High-Low-Close option

tabstat t_good_m t_good_f T_Diff_G T_Diff_se_G if year==2017, by(countryname)

*** Figure 2: Bivariate relationship between discrimination measures and the trade attitude gender gap in 22 OECD countries (Pew Global Attitudes Survey, 2002-2017)
* First list creates fitted line, second line creates scatter chart
* 3 individual graphs merged together in PowerPoint

* left panel (Gender Gap by WBL Index Extended)

quietly: regress T_Diff_G wblindex_ext
predict fitted
scatter T_Diff_G wblindex_ext || line fitted wblindex_ext , xtitle("WBL Index Extended") ytitle("Gender Gap")  msymbol(o)  scheme(s1mono)
graph export figF1_left.png , replace

* middle panel (GGG ECO. P&0)

quietly: regress T_Diff_G GGG_EPO
predict fitted2
scatter T_Diff_G GGG_EPO || line fitted2 GGG_EPO, xtitle("GGG ECO. P&0") ytitle("Gender Gap")  msymbol(o)  scheme(s1mono)
graph export figF1_middle.png , replace

* right panel (Gender Gap by Prioritize Male Jobs)

quietly: regress T_Diff_G jb_agree_a
predict fitted3
scatter T_Diff_G jb_agree_a || line  fitted3 jb_agree_a, xtitle("Prioritize Male Jobs") ytitle("Gender Gap")  msymbol(o)  scheme(s1mono)
graph export figF1_right.png , replace


*** Table 1: Analysis of relationship between discrimination measures and the trade attitudes gender gap (Pew Global Attitudes Survey, 2002-2017)
	
**** PEW Gender Gap Regressions (Table 1: Gender Equality + Trade & Growth)

* Base Estimates (left panel)

quietly: regress T_Diff_G wblindex_ext i.year, cl(countryname)
estimates store m1ext, title("De Jure")
quietly: regress T_Diff_G GGG_EPO i.year, cl(countryname)
estimates store m2, title("De Facto 1")
quietly: regress T_Diff_G jb_agree_a i.year, cl(countryname)
estimates store m3, title("De Facto 2")

* Base + Economic Controls Estimates (right panel)

quietly: regress T_Diff_G wblindex_ext Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m4ext
quietly: regress T_Diff_G GGG_EPO Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m5
quietly: regress T_Diff_G jb_agree_a Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m6

* Exports as main_T1.txt for formatting in Excel

estout m1ext m2 m3 m4ext m5 m6 using "main_T1.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type  style(fixed)

*** Descriptive information provide in section titled "Are female or male responses driving the gender gap?"

* Average gap between the proportion of men and the proportion of women with positive trade attitudes + range

sum t_good_m t_good_f T_Diff_G

* Correlation of men's and women's beliefs about trade and the size of the gender gap

corr t_good_m t_good_f T_Diff_G

*** Table 2: Analysis of gender gap components (Pew Global Attitudes Survey, 2002-2017)

* Female Response Model Estimates (left panel)

quietly: regress T_Diff_G t_good_f wblindex_ext Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m4f_ext
quietly: regress T_Diff_G t_good_f GGG_EPO Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m5f
quietly: regress T_Diff_G t_good_f jb_agree_a Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m6f

* Male Response Model Estimates (right panel)

quietly: regress T_Diff_G t_good_m wblindex_ext Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m4m_ext
quietly: regress T_Diff_G t_good_m GGG_EPO Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m5m
quietly: regress T_Diff_G t_good_m jb_agree_a Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m6m

* Exports as main_T2.txt for formatting in Excel

estout m4f_ext m5f m6f m4m_ext m5m m6m using "main_T2.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)

*** Table 3: Analysis of gender inequality measures on proportion of men and women responding that trade is good for the country (Pew Global Attitudes Survey, 2002-2017)

* Female Response Prop. Estimates (left panel)

quietly: regress t_good_f wblindex_ext Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m4f_ext
quietly: regress t_good_f GGG_EPO Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m5f
quietly: regress t_good_f jb_agree_a Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m6f

* Male Response Prop. Estimates (right panel)

quietly: regress t_good_m wblindex_ext Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m4m_ext
quietly: regress t_good_m GGG_EPO Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m5m
quietly: regress t_good_m jb_agree_a Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m6m

* Exports as main_T3.txt for formatting in Excel

estout m4f_ext m5f m6f m4m_ext m5m m6m  using "main_T3.txt.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)

*** Figure 3 summarizes exported data from Table 1, 2, and 3 and was processed in Excel. See Excel file.

*** Table 4: Analysis of relationship between individual and national characteristics and belief that trade is good for the country (Pew Global Attitudes Survey, 2002-2017)
* Need to switch from country level to individual level data

cd "C:\Users\alexa\Dropbox\Research\Research Projects\Gender Cross National\Submission Docs\FPA_Jan2022\Replication Files"
use "GenderDiff_ind_replication.dta", clear

*codebook

xtset Country

* Base Model Estimates (left panel)

quietly: xtreg trade_good female wblindex_ext i_female_wblindex_ext Trade_prGDP_ln GDP_growth i.year
estimates store m1a, title("WBL")

quietly: xtreg trade_good female GGG_EPO i_female_GGG_EPO Trade_prGDP_ln GDP_growth i.year
estimates store m1b, title("GGG")

quietly: xtreg trade_good female jb_agree_a i_female_jb_agree_a Trade_prGDP_ln GDP_growth i.year
estimates store m1c, title("WVS")

* Base Model + College Estimates (right panel)

quietly: xtreg trade_good female college wblindex_ext i_female_wblindex_ext Trade_prGDP_ln GDP_growth i.year
estimates store m2a, title("WBL")

quietly: xtreg trade_good female college GGG_EPO i_female_GGG_EPO Trade_prGDP_ln GDP_growth i.year
estimates store m2b, title("GGG")

quietly: xtreg trade_good female college jb_agree_a i_female_jb_agree_a Trade_prGDP_ln GDP_growth i.year
estimates store m2c, title("WVS")

* Exports to Excel as main_T4.txt for formatting

estout m1a m1b m1c m2a m2b m2c using "main_T4.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)


**** II. APPENDIX

cd "C:\Users\alexa\Dropbox\Research\Research Projects\Gender Cross National\Submission Docs\FPA_Jan2022\Replication Files"
use "GenderDiff_OECD_replication", clear

*** Table A1: World Bank Labor Equality Index (WBL, 2009-2018)

table countryname year if year>2008, statistic(mean wblindex_ext) nformat(%5.2f) totals(countryname)
tabstat wblindex_ext if year>2008, by(year) statistic(min max mean sd) format(%5.2f)

*** Table A2: Economic Participation and Opportunity Index (GGG, alternate years 2006-2018)

* The table command displays data for each country for the alternating years and tabstat command calculates the mean across the full time period

table countryname year if year==2006 | year==2008 | year==2010 | year==2012 | year==2014 | year==2016 | year==2018, statistic(mean GGG_EPO) nformat(%5.2f) nototals
tabstat GGG_EPO if year>2005, by(countryname) statistic(mean) format(%5.2f)

* The first tabstat summarizes data for each of the alternating years and the second for the full time period

tabstat GGG_EPO if year==2006 | year==2008 | year==2010 | year==2012 | year==2014 | year==2016 | year==2018, by(year) statistic(min max mean sd) format(%5.2f)
tabstat GGG_EPO if year>2005, statistic(min max mean sd) format(%5.2f)


*** Table A3: Prioritize Men's Employment. By country, proportion of respondents agreeing with statement "When jobs are scarce, men should have more right to a job than women." (WVS, waves 3-6)
table countryname year if year==1994 | year==1999 | year==2005 | year==2010, statistic(mean jb_agree_a) nformat(%5.2f) nototals
tabstat jb_agree_a if year==1994 | year==1999 | year==2005 | year==2010, by(year) statistic(count min max mean sd) format(%5.2f) nototal


*** Appendix C: Summary Statistics
* Generates table of Observation, Mean, Standard Deviation, Min, Max for key variables. Data constrained to observations in which Pew Data is available (T_Diff_G exists)
* The sum command below constrained to provide standard statistics for key variables for observations in which dependent variables from Pew Data set (T_Diff_G and t_good_m t_good_f) are available.
sum T_Diff_G t_good_m t_good_f wblindex_ext GGG_EPO jb_agree_a Trade_prGDP_ln Ex_GS_prctGDP_ln GDP_growth if T_Diff_G~=.

* Displays years in which data is available for key variables
foreach var in T_Diff_G t_good_m t_good_f wblindex_ext GGG_EPO jb_agree_a Trade_prGDP_ln Ex_GS_prctGDP_ln GDP_growth {
display "`var'"
tab year if `var'~=.
}


*** Table D1a: Analysis of relationship between discrimination measures and the trade attitudes gender gap (Pew Global Attitudes Survey, 2002-2017) including welfare expenditure

* Main Independent Variable Only (Left Panel)

quietly: regress T_Diff_G wblindex_ext i.year, cl(countryname)
estimates store m1ext, title("De Jure")
quietly: regress T_Diff_G GGG_EPO i.year, cl(countryname)
estimates store m2, title("De Facto 1")
quietly: regress T_Diff_G jb_agree_a i.year, cl(countryname)
estimates store m3, title("De Facto 2")

* Main Independent Variable with Main Economic Variables and Welfare Expenditure (Right Panel)

quietly: regress T_Diff_G wblindex_ext Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m4ext
quietly: regress T_Diff_G GGG_EPO Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m5
quietly: regress T_Diff_G jb_agree_a Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m6

* Exports as Appendix_D1a.txt for formatting in Excel

estout m1ext m2 m3 m4ext m5 m6 using "Appendix_D1a.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)

*** Table D1b: Analysis of relationship between discrimination measures and the trade attitudes gender gap (Pew Global Attitudes Survey, 2002-2017) with lagged independent variables

* Creates lagged variables

sort countryname year
by countryname: generate wblindex_L1=wblindex[_n-1] if countryname[_n-1]==countryname
by countryname: generate wblindex_ext_L1=wblindex_ext[_n-1]
by countryname: generate GGG_EPO_L1=GGG_EPO[_n-1]
by countryname: generate jb_agree_a_L1=jb_agree_a[_n-1]
by countryname: generate Trade_prGDP_ln_L1=Trade_prGDP_ln[_n-1]
by countryname: generate GDP_growth_L1=GDP_growth[_n-1]
by countryname: generate socexp_pub_pcgdp_L1=socexp_pub_pcgdp[_n-1]
by countryname: generate Ex_GS_prctGDP_ln_L1=Ex_GS_prctGDP_ln[_n-1]


* Main Independent Variable Only (Left Panel)

quietly: regress T_Diff_G wblindex_ext_L1 i.year, cl(countryname)
estimates store m1ext, title("De Jure")
quietly: regress T_Diff_G GGG_EPO_L1 i.year, cl(countryname)
estimates store m2, title("De Facto 1")
quietly: regress T_Diff_G jb_agree_a_L1 i.year, cl(countryname)
estimates store m3, title("De Facto 2")

* Main Independent Variable with Main Economic Variables and Welfare Expenditure (Right Panel)

quietly: regress T_Diff_G wblindex_ext_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m4ext
quietly: regress T_Diff_G GGG_EPO_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m5
quietly: regress T_Diff_G jb_agree_a_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m6

* Exports as Appendix_D1b.txt for formatting in Excel

estout m1ext m2 m3 m4ext m5 m6 using "Appendix_D1b.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)


*** Table D2a: Analysis of gender gap components (Pew Global Attitudes Survey, 2002-2017) with welfare spending

* Women's Preference (Left Panel)

quietly: regress T_Diff_G t_good_f wblindex_ext Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m4f_ext
quietly: regress T_Diff_G t_good_f GGG_EPO Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m5f
quietly: regress T_Diff_G t_good_f jb_agree_a Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m6f

* Men's Preference (Right Panel)

quietly: regress T_Diff_G t_good_m wblindex_ext Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m4m_ext
quietly: regress T_Diff_G t_good_m GGG_EPO Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m5m
quietly: regress T_Diff_G t_good_m jb_agree_a Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m6m

* Exports as Appendix_D2a.txt for formatting in Excel

estout m4f_ext m5f m6f m4m_ext m5m m6m using "Appendix_D2a.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)

*** Table D2b: Analysis of gender gap components (Pew Global Attitudes Survey, 2002-2017) with lagged independent variables

* Women's Preference (Left Panel)

quietly: regress T_Diff_G t_good_f wblindex_ext_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m4f_ext
quietly: regress T_Diff_G t_good_f GGG_EPO_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m5f
quietly: regress T_Diff_G t_good_f jb_agree_a_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m6f

* Men's Preference (Right Panel)

quietly: regress T_Diff_G t_good_m wblindex_ext_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m4m_ext
quietly: regress T_Diff_G t_good_m GGG_EPO_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m5m
quietly: regress T_Diff_G t_good_m jb_agree_a_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m6m

* Exports as Appendix_D2b.txt for formatting in Excel

estout m4f_ext m5f m6f m4m_ext m5m m6m using "Appendix_D2b.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)

*** Table D3a: Analysis of gender inequality measures on proportion of men and women responding that trade is good for the country (Pew Global Attitudes Survey, 2002-2017) with welfare spending

* Women's Preference (Left Panel)

quietly: regress t_good_f wblindex_ext Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m4f_ext
quietly: regress t_good_f GGG_EPO Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m5f
quietly: regress t_good_f jb_agree_a Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m6f

* Men's Preference (Right Panel)

quietly: regress t_good_m wblindex_ext Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m4m_ext
quietly: regress t_good_m GGG_EPO Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m5m
quietly: regress t_good_m jb_agree_a Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth socexp_pub_pcgdp i.year, cl(countryname)
estimates store m6m

* Exports as Appendix_D3a.txt for formatting in Excel

estout m4f_ext m5f m6f m4m_ext m5m m6m using "Appendix_D3a.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)

*** Table D3b: Analysis of gender inequality measures on proportion of men and women responding that trade is good for the country (Pew Global Attitudes Survey, 2002-2017) with lagged independent variables

* Women's Preference (Left Panel)

quietly: regress t_good_f wblindex_ext_L1 Ex_GS_prctGDP_ln_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m4f_ext
quietly: regress t_good_f GGG_EPO_L1 Ex_GS_prctGDP_ln_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m5f
quietly: regress t_good_f jb_agree_a_L1 Ex_GS_prctGDP_ln_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m6f

* Men's Preference (Right Panel)

quietly: regress t_good_m wblindex_ext_L1 Ex_GS_prctGDP_ln_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m4m_ext
quietly: regress t_good_m GGG_EPO_L1 Ex_GS_prctGDP_ln_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m5m
quietly: regress t_good_m jb_agree_a_L1 Ex_GS_prctGDP_ln_L1 Trade_prGDP_ln_L1 GDP_growth_L1 socexp_pub_pcgdp_L1 i.year, cl(countryname)
estimates store m6m

* Exports as Appendix_D3a.txt for formatting in Excel

estout m4f_ext m5f m6f m4m_ext m5m m6m using "Appendix_D3b.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)

*** Table E1: Analysis of relationship between discrimination measures and the trade attitudes gender gap (Pew Global Attitudes Survey, 2002-2017) with no extension of the WBL Index

* Base Model Estimates (Left Panel)
quietly: regress T_Diff_G wblindex i.year, cl(countryname)
estimates store m1, title("De Jure")
quietly: regress T_Diff_G GGG_EPO i.year, cl(countryname)
estimates store m2, title("De Facto 1")
quietly: regress T_Diff_G jb_agree_a i.year, cl(countryname)
estimates store m3, title("De Facto 2")

* Based + Economic Controls Estimates (Right Panel)

quietly: regress T_Diff_G wblindex Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m4
quietly: regress T_Diff_G GGG_EPO Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m5
quietly: regress T_Diff_G jb_agree_a Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m6

* Exports as Appendix_E1.txt for formatting in Excel

estout m1 m4 m5 m6 using "Appendix_E1.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)

*** Table E2: Analysis of gender gap components (Pew Global Attitudes Survey, 2002-2017) with no extension of the WBL Index

* Female Response Model (left panel)

quietly: regress T_Diff_G t_good_f wblindex Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m4f
quietly: regress T_Diff_G t_good_f GGG_EPO Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m5f
quietly: regress T_Diff_G t_good_f jb_agree_a Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m6f

* Male Response Model (right panel)

quietly: regress T_Diff_G t_good_m wblindex Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m4m
quietly: regress T_Diff_G t_good_m GGG_EPO Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m5m
quietly: regress T_Diff_G t_good_m jb_agree_a Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m6m

* Exports as Appendix_E2.txt for formatting in Excel

estout m4f m5f m6f m4m m5m m6m using "Appendix_E2.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)

*** Table E3: Analysis of gender inequality measures on proportion of men and women responding that trade is good for the country (Pew Global Attitudes Survey, 2002-2017) with no extension of the WBL Index

* Female Preference Model (Left Panel)

quietly: regress t_good_f wblindex Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m4f
quietly: regress t_good_f GGG_EPO Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m5f
quietly: regress t_good_f jb_agree_a Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m6f

* Male Preference Model (Left Panel)

quietly: regress t_good_m wblindex Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m4m
quietly: regress t_good_m GGG_EPO Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m5m
quietly: regress t_good_m jb_agree_a Ex_GS_prctGDP_ln Trade_prGDP_ln GDP_growth i.year, cl(countryname)
estimates store m6m

* Exports as Appendix_E3.txt for formatting in Excel

estout m4f m5f m6f m4m m5m m6m  using "Appendix_E3.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)


**** Appendix F: Gender Equality and College Education

*** Table F1: Analysis of gender inequality measures on likelihood of respondent holding a college degree (Pew Global Attitudes Survey, 2002-2017)

cd "C:\Users\alexa\Dropbox\Research\Research Projects\Gender Cross National\Submission Docs\FPA_Jan2022\Replication Files"
use "GenderDiff_ind_replication.dta", clear
xtset Country

quietly: xtreg college female i.year
quietly: xtreg college female wblindex_ext i_female_wblindex_ext i.year
estimates store Educ_WBL, title("WBL")
predict pr_college_male_WBL if e(sample) & female==0
predict pr_college_female_WBL if e(sample) & female==1

quietly: xtreg college female GGG_EPO i_female_GGG_EPO i.year
estimates store Educ_GGG, title("GGG")
predict pr_college_male_GGG if e(sample) & female==0
predict pr_college_female_GGG if e(sample) & female==1

quietly: xtreg college female jb_agree_a i_female_jb_agree_a i.year
estimates store Educ_WVS, title("WVS")
predict pr_college_male_WVS if e(sample) & female==0
predict pr_college_female_WVS if e(sample) & female==1

* Exports as Appendix_F1.txt for formatting in Excel

estout Educ_WBL Educ_GGG Educ_WVS using "Appendix_F1.txt" ,cells(b(star fmt(2)) se(par fmt(2))) stats(N r2) starlevels(* 0.10 ** 0.05 *** .01) legend replace type style(fixed)
 
*** Figure F1: Prediction of Gender Gap in Education by GGG EPO Gender Equality Measure (Pew Global Attitudes Survey, 2002-2017)

 #delim ;
 twoway (lowess pr_college_female_GGG GGG_EPO, lcolor(red) lwidth(medthick) lpattern(dot))
(lowess pr_college_male_GGG GGG_EPO, lcolor(dknavy) lpattern(dash)) //
(histogram GGG_EPO, yaxis(2) bin(50) fcolor(none) lcolor(gs10) lwidth(vthin)), //
 ytitle(Proportion of College Degree Holders By Gender) ytitle(Density, axis(2)) xtitle(GGG_EPO Equality Index) legend(order(1 "Female" 2 "Male")) scheme(s2mono);
 graph export appendix_figF1.png , replace
 
 log close
